package router

import (
	"gin-study/controller"
	"gin-study/response"
	"github.com/gin-gonic/gin"
)

func IndexHandler(c *gin.Context) {
	c.JSON(200, response.Fail("这是一个测试信息"))
}

func RegisterRoutes(router *gin.Engine) {
	// 注册原有路由
	router.GET("/ping", IndexHandler)
	
	// 创建 HelloController 实例
	helloController := controller.NewHelloController()
	
	// 注册 HelloController 的路由
	router.GET("/hello", helloController.SayHello)
	router.GET("/hello/:name", helloController.SayHelloToUser)
}